﻿using System;

namespace OpenWaves.ActivityFeed.UnitTests
{
    public class DummyUpdateContent : UpdateContent
    {
        public DummyUpdateContent()
        {
            this.Text = Guid.NewGuid().ToString();
        }

        public DummyUpdateContent(string text)
        {
            this.Text = text;
        }

        public string Text { get; set; }

        public bool Equals(DummyUpdateContent other)
        {
            if (ReferenceEquals(null, other)) return false;
            if (ReferenceEquals(this, other)) return true;
            return Equals(other.Text, this.Text);
        }

        public override bool Equals(object obj)
        {
            if (ReferenceEquals(null, obj)) return false;
            if (ReferenceEquals(this, obj)) return true;
            if (obj.GetType() != typeof (DummyUpdateContent)) return false;
            return Equals((DummyUpdateContent) obj);
        }

        public override int GetHashCode()
        {
            return (this.Text != null ? this.Text.GetHashCode() : 0);
        }
    }
}